GtkContainer is going away.
child = gtk_widget_get_first_child (variations_grid);
while ((child = gtk_widget_get_first_child (variations_grid)))
- gtk_container_remove (GTK_CONTAINER (variations_grid), child);
+ gtk_grid_remove (GTK_GRID (variations_grid), child);
instance_combo = NULL;
gtk_color_chooser_widget_set_use_alpha (GtkColorChooserWidget *cc,
gboolean use_alpha)
{
- GList *children, *l;
GList *palettes, *p;
- GtkWidget *swatch;
+ GtkWidget *child;
GtkWidget *grid;
if (cc->use_alpha == use_alpha)
{
grid = p->data;
- if (!GTK_IS_CONTAINER (grid))
- continue;
-
- children = gtk_container_get_children (GTK_CONTAINER (grid));
- for (l = children; l; l = l->next)
+ for (child = gtk_widget_get_first_child (grid);
+ child != NULL;
+ child = gtk_widget_get_next_sibling (child))
{
- swatch = l->data;
- gtk_color_swatch_set_use_alpha (GTK_COLOR_SWATCH (swatch), use_alpha);
+ if (GTK_IS_COLOR_SWATCH (child))
+ gtk_color_swatch_set_use_alpha (GTK_COLOR_SWATCH (child), use_alpha);
}
- g_list_free (children);
}
g_list_free (palettes);
gtk_widget_get_parent (GTK_WIDGET (cc->current)) != cc->custom)
cc->current = NULL;
- children = gtk_container_get_children (GTK_CONTAINER (cc->palette));
+ children = NULL;
+ for (widget = gtk_widget_get_first_child (cc->palette);
+ widget != NULL;
+ widget = gtk_widget_get_next_sibling (widget))
+ children = g_list_prepend (children, widget);
+
for (l = children; l; l = l->next)
{
widget = l->data;
const GdkRGBA *color)
{
GtkColorChooserWidget *cc = GTK_COLOR_CHOOSER_WIDGET (chooser);
- GList *children, *l;
GList *palettes, *p;
- GtkColorSwatch *swatch;
+ GtkWidget *swatch;
GtkWidget *w;
GdkRGBA c;
if (!GTK_IS_GRID (w) && !GTK_IS_BOX (w))
continue;
- children = gtk_container_get_children (GTK_CONTAINER (w));
- for (l = children; l; l = l->next)
+ for (swatch = gtk_widget_get_first_child (w);
+ swatch != NULL;
+ swatch = gtk_widget_get_next_sibling (swatch))
{
- swatch = l->data;
- gtk_color_swatch_get_rgba (swatch, &c);
+ gtk_color_swatch_get_rgba (GTK_COLOR_SWATCH (swatch), &c);
if (!cc->use_alpha)
c.alpha = color->alpha;
if (gdk_rgba_equal (color, &c))
{
- select_swatch (cc, swatch);
- g_list_free (children);
+ select_swatch (cc, GTK_COLOR_SWATCH (swatch));
g_list_free (palettes);
return;
}
}
- g_list_free (children);
}
g_list_free (palettes);
GtkFontChooserWidget *fontchooser = data;
Axis *a = value;
- gtk_container_remove (GTK_CONTAINER (fontchooser->axis_grid), a->label);
- gtk_container_remove (GTK_CONTAINER (fontchooser->axis_grid), a->scale);
- gtk_container_remove (GTK_CONTAINER (fontchooser->axis_grid), a->spin);
+ gtk_grid_remove (GTK_GRID (fontchooser->axis_grid), a->label);
+ gtk_grid_remove (GTK_GRID (fontchooser->axis_grid), a->scale);
+ gtk_grid_remove (GTK_GRID (fontchooser->axis_grid), a->spin);
}
static void
gtk_widget_set_hexpand (label, TRUE);
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
- gtk_container_add (GTK_CONTAINER (grid), label);
+ gtk_grid_attach (GTK_GRID (grid), label, 0, 0, 1, 1);
/* the uri itself */
label = gtk_label_new (uris[i]);
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
gtk_widget_add_css_class (label, "dim-label");
- gtk_container_add (GTK_CONTAINER (grid), label);
+ gtk_grid_attach (GTK_GRID (grid), label, 0, 1, 1, 1);
/* remove button */
button = gtk_button_new_from_icon_name ("window-close-symbolic");
gtk_widget_add_css_class (button, "sidebar-button");
gtk_grid_attach (GTK_GRID (grid), button, 1, 0, 1, 2);
- gtk_container_add (GTK_CONTAINER (row), grid);
+ gtk_list_box_row_set_child (GTK_LIST_BOX_ROW (row), grid);
gtk_container_add (GTK_CONTAINER (view->recent_servers_listbox), row);
/* custom data */
grid_rows (GtkGrid *table)
{
gint t0, t1, l, t, w, h;
- GList *children, *c;
+ GtkWidget *c;
+ gboolean first;
- children = gtk_container_get_children (GTK_CONTAINER (table));
t0 = t1 = 0;
- for (c = children; c; c = c->next)
+ for (c = gtk_widget_get_first_child (GTK_WIDGET (table)), first = TRUE;
+ c != NULL;
+ c = gtk_widget_get_next_sibling (GTK_WIDGET (c)), first = FALSE)
{
- gtk_grid_query_child (table, c->data, &l, &t, &w, &h);
- if (c == children)
+ gtk_grid_query_child (table, c, &l, &t, &w, &h);
+ if (first)
{
t0 = t;
t1 = t + h;
t1 = t + h;
}
}
- g_list_free (children);
return t1 - t0;
}
return;
while ((child = gtk_widget_get_first_child (dialog->finishing_table)))
- gtk_container_remove (GTK_CONTAINER (dialog->finishing_table), child);
+ gtk_grid_remove (GTK_GRID (dialog->finishing_table), child);
while ((child = gtk_widget_get_first_child (dialog->image_quality_table)))
- gtk_container_remove (GTK_CONTAINER (dialog->image_quality_table), child);
+ gtk_grid_remove (GTK_GRID (dialog->image_quality_table), child);
while ((child = gtk_widget_get_first_child (dialog->color_table)))
- gtk_container_remove (GTK_CONTAINER (dialog->color_table), child);
+ gtk_grid_remove (GTK_GRID (dialog->color_table), child);
while ((child = gtk_widget_get_first_child (dialog->advanced_vbox)))
gtk_container_remove (GTK_CONTAINER (dialog->advanced_vbox), child);
while ((child = gtk_widget_get_first_child (dialog->extension_point)))
gtk_grid_set_column_spacing (GTK_GRID (grid), 5);
gtk_grid_set_row_spacing (GTK_GRID (grid), 5);
test1 = test_widget ("1", "red");
- gtk_container_add (GTK_CONTAINER (grid), test1);
+ gtk_grid_attach (GTK_GRID (grid), test1, 0, 0, 1, 1);
test2 = test_widget ("2", "green");
- gtk_container_add (GTK_CONTAINER (grid), test2);
+ gtk_grid_attach (GTK_GRID (grid), test2, 1, 0, 1, 1);
test3 = test_widget ("3", "blue");
- gtk_container_add (GTK_CONTAINER (grid), test3);
+ gtk_grid_attach (GTK_GRID (grid), test3, 2, 0, 1, 1);
test4 = test_widget ("4", "green");
gtk_grid_attach (GTK_GRID (grid), test4, 0, 1, 1, 1);
gtk_widget_set_vexpand (test4, TRUE);
label = gtk_label_new ("Out of overlay");
gtk_widget_set_hexpand (label, TRUE);
gtk_widget_set_vexpand (label, TRUE);
- gtk_container_add (GTK_CONTAINER (grid), label);
+ gtk_grid_attach (GTK_GRID (grid), label, 0, 0, 1, 1);
overlay = gtk_overlay_new ();
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_container_add (GTK_CONTAINER (box), grid);
label = gtk_label_new ("Hello World");
- gtk_container_add (GTK_CONTAINER (grid), label);
+ gtk_grid_attach (GTK_GRID (grid), label, 0, 0, 1, 1);
return label;
}
assert_model (model, "GtkLabel GtkGrid GtkBox GtkWindow");
assert_changes (model, "0+4");
- gtk_container_remove (GTK_CONTAINER (parent), widget);
+ gtk_grid_remove (GTK_GRID (parent), widget);
assert_model (model, "GtkLabel");
assert_changes (model, "1-3");